<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- 个人情况中的积分记录界面  -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<link rel="stylesheet" href="../../bootstrap-table/bootstrap.min.css" />
<link rel="stylesheet" href="../../bootstrap-table/bootstrap-table.css">
<link rel="stylesheet" href="../../css/other.css" />
<link rel="stylesheet" href="../../css/home.css" />
<script src="../../js/jquery.min.js"></script>
<script src="../../js/header.js"></script>
<script src="../../bootstrap-table/bootstrap-table.js"></script>
<script src="../../bootstrap-table/bootstrap-table-zh-CN.min.js"></script>
<title>智行校园-精准化服务平台</title>
</head>
<body>
	<input id="the_value" value="积分记录" style="display: none" />
	<div class="the_container">
		<div class="the_lcontainer col-2"></div>
		<div class="the_rcontainer ">
			<h3 style="font-size:1.2em;font-weight:600">
				积分记录 <label class="my_points"> ( 我的当前积分： 0 )</label>
			</h3>
			<div class="points_buttons">
				<button class="selected">所有记录</button>
				<button>获取记录</button>
				<button>使用记录</button>
			</div>
			<table id="the_table"></table>
		</div>
	</div>
	<script src="../../js/leftcol.js"></script>
	<script>
	  var user_id='11204050220';
		$(function() {
			var colums = [[ "the_time", "the_action","the_points", "beside" ],[ "时间", "行为", "金币数", "备注" ] ];
			$.ajax({
						url : '../../jsp/personal_center/point_notes.json',
						data:{param1:user_id},
						type : 'post'
					})
					.done(function(data) {
								//$('label.my_points').text(' ( 我的当前积分： ' + data.points + ')');
								paint_table("the_table","../../jsp/personal_center/point_notes.json?param1="+user_id+" &param2="+$('div.points_buttons button.selected').text(),colums,  10, true);
							});
			$('div.points_buttons button').click(
					function() {
						$(this).addClass('selected').siblings().removeClass('selected');
						$('#the_table').bootstrapTable('refresh',{
							url:"../../jsp/personal_center/point_notes.json?param1="+user_id+" &param2="+$(this).text()
						});
					});
		});
		function paint_table(id, data,colums, number, pagination) {
			var colum = [];
			for (var i = 0; i < colums[0].length; i++)
				colum[i] = {
					field : colums[0][i],
					title : colums[1][i],
					valign : "middle",
					align : "center"
				};
			$('#' + id).bootstrapTable({
				url : data,
				columns : colum,
				sidePagination : 'server',
				pagination : pagination,
				pageSize : number,
				search : false,
				searchOnEnterKey : true,
				locale : 'zh-CN'
			});
		}
	</script>
</body>
</html>